--- id: TASK-002 title: Editor inserts double space per spacebar press status: "\U0001F3C1 Done" assignee: [] created_date: '2026-06-28 18:21' updated_date: '2026-06-28 18:22' labels: - bug dependencies: [] priority: high ordinal: 2000 --- ## Description HandleKey case 'tea.KeyRunes, tea.KeySpace' loops over k.Runes inserting each rune, THEN an 'if k.Type == tea.KeySpace { InsertRune(" ") }' inserts another. In real bubbletea (v1.3.6 key.go) a space keypress is Key{Type:KeySpace, Runes:[' ']}, so both fire → two spaces. v1 test TestHandleKeySpaceInsertsSingleSpace missed it by sending KeySpace with empty Runes (unrealistic). Fix: drop the redundant if-block; make the test send Runes:[' ']. ## Acceptance Criteria - [ ] #1 single space inserted per spacebar press in the real terminal - [ ] #2 test sends a realistic KeySpace msg (Runes: [' '])